import React from 'react';
import {Router, Route} from 'dva/router';
import IndexPage from './routes/IndexPage';
import Users from './routes/Users';
import Votes from './routes/Votes';
import User from './routes/User';
import Roles from './routes/Roles';
import Usermodify from './routes/Usermodify';
import Login from './routes/Login';

import Rolelist from "./routes/Rolelist.js";

import Voteadd from "./routes/Voteadd.js";

import Votemodify from "./routes/Votemodify.js";

import Vote from "./routes/Vote.js";

import Subjects from "./routes/Subjects.js";

import Candidates from "./routes/Candidates.js";

import Subjectadd from "./routes/Subjectadd.js";

import Candidateadd from "./routes/Candidateadd.js";

import Candidate from "./routes/Candidate.js";

function RouterConfig({history}) {
  return (
    <Router history={history}>
      <Route path="/" component={IndexPage}/>
      <Route path="/users" component={Users}/>
      <Route path="/votes" components={Votes}/>
      <Route path="/user" components={User}/>
      <Route path="/usermodify" components={Usermodify}/>
      <Route path="/roles" components={Roles}/>
      <Route path="/rolelist" component={Rolelist}/>
      <Route path="/voteadd" component={Voteadd}/>
      <Route path="/login" component={Login}/>
      <Route path="/votemodify" component={Votemodify} />
      <Route path="/vote" component={Vote} />
      <Route path="/subjects" component={Subjects} />
      <Route path="/candidates" component={Candidates} />
      <Route path="/subjectadd" component={Subjectadd} />
      <Route path="/candidateadd" component={Candidateadd} />
      <Route path="/candidate" component={Candidate} />
    </Router>
  );
}

export default RouterConfig;
